package com.zq.learing.base.实用;

/**
 * @Author: zhaoqi
 * @Date: 12/4/2019 9:59 PM
 * @Version 1.0
 */

public class StringReverse {

    public static void main(String[] args) {
        System.out.println(reeverse("Hello!"));
    }

    private static String reeverse(String originStr) {
        if (originStr == null || originStr.length() == 1){
            return originStr;
        }
        System.out.println(originStr.substring(1));
        System.out.println(originStr.charAt(0));
        return reeverse(originStr.substring(1)) + originStr.charAt(0);
    }

}
